<html>
<head><meta charset="utf-8"><title>Bug in config.toml wasi-root field? · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Bug.20in.20config.2Etoml.20wasi-root.20field.3F.html">Bug in config.toml wasi-root field?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="205789577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Bug%20in%20config.toml%20wasi-root%20field%3F/near/205789577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Bug.20in.20config.2Etoml.20wasi-root.20field.3F.html#205789577">(Aug 03 2020 at 12:51)</a>:</h4>
<p>I have this in my config.toml</p>
<div class="codehilite"><pre><span></span><code>target = [&quot;x86_64-unknown-linux-gnu&quot;, &quot;wasm32-unknown-emscripten&quot;, &quot;wasm32-wasi&quot;]
...
wasi-root = &quot;/home/omer/wasi-sdk-11.0/share/wasi-sysroot&quot;
</code></pre></div>


<p>This is the panic I'm getting when I do <code>x.py build</code>:</p>
<div class="codehilite"><pre><span></span><code>thread &#39;main&#39; panicked at &#39;called `Option::unwrap()` on a `None` value&#39;, src/bootstrap/compile.rs:187:48
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failed to run: /home/omer/rust/rust/build/bootstrap/debug/bootstrap build
Build completed unsuccessfully in 0:00:05
</code></pre></div>


<p>Panicking line:</p>
<div class="codehilite"><pre><span></span><code>let srcdir = builder.wasi_root(target).unwrap().join(&quot;lib/wasm32-wasi&quot;);
</code></pre></div>


<p>I have a wasi_root field already so I'm not sure why this is failing. Any ideas?</p>



<a name="205790460"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Bug%20in%20config.toml%20wasi-root%20field%3F/near/205790460" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Bug.20in.20config.2Etoml.20wasi-root.20field.3F.html#205790460">(Aug 03 2020 at 13:01)</a>:</h4>
<p><span class="user-mention" data-user-id="119169">@osa1</span> is the wasi-root in a target config for, uh, whatever target you're trying to build for?</p>



<a name="205790488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Bug%20in%20config.toml%20wasi-root%20field%3F/near/205790488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Bug.20in.20config.2Etoml.20wasi-root.20field.3F.html#205790488">(Aug 03 2020 at 13:01)</a>:</h4>
<p>(I guess wasm32-unknown-wasi?)</p>



<a name="205790577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Bug%20in%20config.toml%20wasi-root%20field%3F/near/205790577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Bug.20in.20config.2Etoml.20wasi-root.20field.3F.html#205790577">(Aug 03 2020 at 13:02)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> the wasi-root field is already in the config.toml.example, it's commented out, I just enabled it and updated the value. Should I move it to elsewhere?</p>



<a name="205790590"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Bug%20in%20config.toml%20wasi-root%20field%3F/near/205790590" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Bug.20in.20config.2Etoml.20wasi-root.20field.3F.html#205790590">(Aug 03 2020 at 13:02)</a>:</h4>
<p>let me look</p>



<a name="205790649"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Bug%20in%20config.toml%20wasi-root%20field%3F/near/205790649" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Bug.20in.20config.2Etoml.20wasi-root.20field.3F.html#205790649">(Aug 03 2020 at 13:03)</a>:</h4>
<p>Oh wow, you're right, I need a new section for the target</p>



<a name="205790652"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Bug%20in%20config.toml%20wasi-root%20field%3F/near/205790652" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Bug.20in.20config.2Etoml.20wasi-root.20field.3F.html#205790652">(Aug 03 2020 at 13:03)</a>:</h4>
<p>yeah it's under <code>target.x86_64-unknown-linux-gnu</code> which is useless afaict, you probably want to move it to <code>target.wasm32-unknown-wasi</code> or whatever the triple is (I forget)</p>



<a name="205790666"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Bug%20in%20config.toml%20wasi-root%20field%3F/near/205790666" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Bug.20in.20config.2Etoml.20wasi-root.20field.3F.html#205790666">(Aug 03 2020 at 13:03)</a>:</h4>
<p>Yeah this works:</p>
<div class="codehilite"><pre><span></span><code>[target.wasm32-wasi]
wasi-root = &quot;/home/omer/wasi-sdk-11.0/share/wasi-sysroot&quot;

[target.wasm32-unknown-emscripten]
wasi-root = &quot;/home/omer/wasi-sdk-11.0/share/wasi-sysroot&quot;
</code></pre></div>



<a name="205790674"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Bug%20in%20config.toml%20wasi-root%20field%3F/near/205790674" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Bug.20in.20config.2Etoml.20wasi-root.20field.3F.html#205790674">(Aug 03 2020 at 13:03)</a>:</h4>
<p>I'd be happy to take a patch fixing the config.toml.example</p>



<a name="205790906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Bug%20in%20config.toml%20wasi-root%20field%3F/near/205790906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Bug.20in.20config.2Etoml.20wasi-root.20field.3F.html#205790906">(Aug 03 2020 at 13:05)</a>:</h4>
<p>Will submit a PR.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>